﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;

namespace AngleExpress.software
{
    /// <summary>
    /// Infos.xaml 的交互逻辑
    /// </summary>
    public partial class Infos : Window
    {
        readonly string username;
        readonly string password;
        public Infos(string title, string username, string password)
        {
            InitializeComponent();
            this.username = username;
            this.password = password;
            this.Title = title + "账密";
            LabelUserName.Content = username;
            if (!string.IsNullOrEmpty(this.password))
                LabelPassword.Content = "***************";
        }

        private void CopyUserName_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                Clipboard.SetText(username);

            } catch(Exception)
            {
                utils.Utils.ShowError("您的剪切板已被占用");
            }
        }

        private void CopyPassword_Click(object sender, RoutedEventArgs e)
        {
            try { 
                Clipboard.SetText(password);
            }catch(Exception)
            {
                utils.Utils.ShowError("您的剪切板已被占用");
            }
        }
    }
}
